package cn.com.nes.site.service.maintenanceReminder.impl;
import cn.com.nes.mybatis.agent.maintenanceReminder.mapper.MaintenanceEquipmentMapper;
import cn.com.nes.site.entity.dto.maintenanceReminder.MaintenanceEquipmentDto;
import cn.com.nes.site.entity.vo.maintenanceReminder.MaintenanceEquipmentVo;
import cn.com.nes.site.service.maintenanceReminder.MaintenanceEquipmentService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;


@Service
public class MaintenanceEquipmentServiceImpl implements MaintenanceEquipmentService {
    @Resource
    private MaintenanceEquipmentMapper maintenanceEquipmentMapper;


    @Override
    public Integer addMaintenanceEquipment(MaintenanceEquipmentVo vo) {
        vo.setManufactureId(vo.getOperateUserCompanyId());
        return maintenanceEquipmentMapper.addMaintenanceEquipment(vo);
    }

    @Override
    public Page<MaintenanceEquipmentDto> queryMaintenanceEquipment(MaintenanceEquipmentVo vo) {
        Page<MaintenanceEquipmentDto> page =new Page<>(vo.getPageid(), vo.getPagesize());
        vo.setManufactureId(vo.getOperateUserCompanyId());
        return page.setRecords(maintenanceEquipmentMapper.queryMaintenanceEquipment(page,vo));
    }

    @Override
    public Integer deleteMaintenanceEquipment(MaintenanceEquipmentVo vo) {
        return maintenanceEquipmentMapper.deleteMaintenanceEquipmentById(vo);
    }
    @Override
    public Integer updateMaintenanceEquipment (MaintenanceEquipmentVo vo){
        return maintenanceEquipmentMapper.updateMaintenanceEquipment(vo);
    }
}
